/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Principal;

import java.awt.print.PrinterException;

/**
 *
 * @author pato
 */
public class imprimir extends Thread {

    public static boolean twice = false;

    public imprimir() {

    }

    public void run() {
        try {

           //  System.out.println("imprimir"+Ticket.credito);
              if (twice) {
                Ticket.impreso=false;
                Ticket.credito=true;
                Ticket.job.print();
                //System.out.println("twice"+Ticket.credito);
            }
            Ticket.job.print();           
            // System.out.println("uno");
            Ticket.subCabezaLineas.clear();
            Ticket.importes.clear();
            Ticket.nombres.clear();
            Ticket.nombre = "";
            Ticket.items.clear();
            Ticket.impreso = false;
            Ticket.credito=false;
            twice=false;
        } catch (PrinterException e) {
            System.out.println("Error de impresión: " + e);
        }
    }

}
